//mock数据模拟
import Mock from 'mockjs'

//图标数据
let List = []
export default {
  getStatisticalData: () => {
    //Mock.Random.float 产生随机数100到8000之间 保留小数 最小0位 最大0位
    for (let i = 0; i < 7; i++) {
      List.push(
        Mock.mock({
          grape: Mock.Random.float(100, 8000, 0, 0),
          banana: Mock.Random.float(100, 8000, 0, 0),
          apple: Mock.Random.float(100, 8000, 0, 0),
          milk: Mock.Random.float(100, 8000, 0, 0),
          cake: Mock.Random.float(100, 8000, 0, 0),
        })
      )
    }
    return {
      code: 20000,
      data: {
        //饼图
        videoData: [
          {
            name: "grape",
            value: 2999
          },
          {
            name: "banana",
            value: 2999
          },
          {
            name: "apple",
            value: 2999
          },
          {
            name: "milk",
            value: 2999
          },
          {
            name: "cake",
            value: 2999
          },
          {
            name: "orange",
            value: 2999
          },
        ],
        //柱状图
        userData:[
          {
            date: '周一',
            new: 100,
            active: 200
          },
          {
            date: '周二',
            new: 140,
            active: 300
          },
          {
            date: '周三',
            new: 190,
            active: 550
          },
          {
            date: '周四',
            new: 90,
            active: 170
          },
          {
            date: '周五',
            new: 20,
            active: 127
          },
        ],
        // 折线图
        orderData:{
          date:['2022-03-13','2022-03-14','2022-03-15','2022-03-16','2022-03-17'],
          data:List
        },
        tableData: [
          {
            name: 'grape',
            todayBuy: 100,
            monthBuy: 200,
            totalBuy: 1000
          },
          {
            name: 'banana',
            todayBuy: 101,
            monthBuy: 300,
            totalBuy: 1200
          },
          {
            name: 'apple',
            todayBuy: 102,
            monthBuy: 400,
            totalBuy: 1400
          },
          {
            name: 'milk',
            todayBuy: 103,
            monthBuy: 500,
            totalBuy: 1500
          },
          {
            name: 'cake',
            todayBuy: 104,
            monthBuy: 600,
            totalBuy: 1600
          },
          {
            name: 'orange',
            todayBuy: 105,
            monthBuy: 700,
            totalBuy: 1700
          }
        ]
      },
    }
  }
}
